package com.example.dockercompose.mapper;

import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StationMapper {

    @Select("SELECT * FROM stations WHERE id = #{id}")
    StationPO findByID(Long id);

    @Select("SELECT s.id, s.name, c.lat, c.lon, c.alt FROM stations s inner join station_coords c on s.id = c.station_id")
    List<StationPO> findAll();
    
    class StationPO {
        public Long id;
        public String name;
        public double lat;
        public double lon;
        public double alt;
    }
}
